package edu.pku.sei.modeler.uml.commands.deployment;

import org.eclipse.draw2d.geometry.Rectangle;

import edu.pku.sei.modeler.exceptions.FactoryNotFoundException;
import edu.pku.sei.modeler.model.common.AbstractFactory;
import edu.pku.sei.modeler.model.common.ModelRegistry;
import edu.pku.sei.modeler.model.core.MetaPackage;
import edu.pku.sei.modeler.model.structure.MetaNode;
import edu.pku.sei.modeler.model.uml.Artifacts.Artifact;
import edu.pku.sei.modeler.model.uml.Kernel.NamedElement;
import edu.pku.sei.modeler.model.uml.Nodes.Deployment;
import edu.pku.sei.modeler.model.uml.Nodes.Node;
import edu.pku.sei.modeler.uml.commands.NestedElementCreateCommand;
import edu.pku.sei.modeler.uml.modelHelper.ModelPackage;

public class NestedArtifactElementCreateCommand extends NestedElementCreateCommand{
	private Artifact father;
	private Artifact child;
	public NestedArtifactElementCreateCommand(MetaNode node,
			MetaNode fatherNode, Rectangle constraint) {
		super(node, fatherNode, constraint);
		father = (Artifact) fatherNode.getModelElement();
		child = (Artifact) node.getModelElement();
	}
	@Override
	protected void updateModelElement() {
		father.getNestedArtifact().add(child);
	}

	@Override
	protected void undoModelElement() {
		father.getNestedArtifact().remove(child);
	}

}
